ÄúµÄλÖãºÑ°ÃÎÍøÊ×Ò³£¾±à³ÌÀÖÔ°£¾VBScript£¾VBScript


objects constants operators statements functions properties methods






FUNCTION:  VarType( )

VarType(Varname)

The VarType function is used to determine the subtype of a named variable.

The output of this function is a value which is a VarType CONSTANT.

CONSTANTVALUEDESCRIPTION
VBEmpty0Uninitialized
VBNull1Contains no valid data
VBInteger2Integer subtype
VBLong3Long subtype
VBSingle4Single subtype
VBDouble5Double subtype
VBCurrency6Currency subtype
VBDate7Date subtype
VBString8String subtype
VBObject9Object
VBError10Error subtype
VBBoolean11Boolean subtype
VBVariant12Variant (only use for arrays of variants)
VBDataObject13Data access object
VBDecimal14Decimal subtype
VBByte17Byte subtype
VBArray8192Array


Code:
<% whatsubtype="This is a string subtype" %>
<% =VarType(whatsubtype) %>

Output:
8

Code:
<% whatsubtype=12345 %>
<% =VarType(whatsubtype) %>

Output:
2